
/**
 * 处理购物车数据为需要格式
 * @param {Array} cartList 购物车数据
 */
export const dealBagListData = (cartList = []) => {
    const storeList = [];
    for (let i = 0; i < cartList.length; i++) {
        const item = cartList[i];
        if (storeList.filter(temp => temp.id === item.store_id).length > 0) continue;
        storeList.push({
            id: item.store_id,
            name: item.store_name,
        });
    }
    return storeList.map(item => {
        return {
            ...item,
            prodsList: [{
                discountInfo: null,
                list: cartList.filter(t => t.store_id === item.id),
            }]
        };
    });
};

/**
 * 购物车添加活动信息
 * @param {Array} bagList 购物车数据
 * @param {Array} activityList 活动信息
 */
export const dealBagListAddActivity = (bagList, activityList) => {

};
